<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">

<head>

<meta charset="UTF-8">
    <meta name="description" content="">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <!-- The above 4 meta tags *must* come first in the head; any other head content must come *after* these tags -->

    <!-- Title -->
    <title>竹里馆民宿</title>
	
    <!-- Favicon -->
    <link rel="icon" href="${pageContext.request.contextPath}/front/img/core-img/favicon.ico">
	
	<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
	
    <!-- Core Stylesheet -->
    <link rel="stylesheet" href="style.css">
    <%-- <link href="${pageContext.request.contextPath}/front/css/bootstrap.css" type="text/css" rel="stylesheet"
	media="all"> --%>
<script type="application/x-javascript">
	 addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } 
</script>
<!-- //Custom Theme files -->
<link href="${pageContext.request.contextPath}/front/css/bootstrap.css" type="text/css" rel="stylesheet"
	media="all">
<link href="${pageContext.request.contextPath}/front/css/style.css" type="text/css" rel="stylesheet" media="all">
<!-- js -->
<script src="${pageContext.request.contextPath}/front/js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap-3.1.1.min.js"></script> 
<script src="${pageContext.request.contextPath}/front/js/imagezoom.js"></script>
<!-- //js -->
<!-- cart -->
<script src="${pageContext.request.contextPath}/front/js/simpleCart.min.js">
	
</script>
<!-- cart -->
<!-- FlexSlider -->
<script defer src="${pageContext.request.contextPath}/front/js/jquery.flexslider.js"></script>
<link rel="stylesheet" href="${pageContext.request.contextPath}/front/css/flexslider.css" type="text/css"
	media="screen" />
	
	<!-- 天气预报 -->
	<link href="${pageContext.request.contextPath}/css/style.css" rel="stylesheet" type="text/css" media="all"/>
<script>
	// Can also be used with $(document).ready()
	$(window).load(function() {
		$('.flexslider').flexslider({
			animation : "slide",
			controlNav : "thumbnails"
		});
	});
</script>
<style type="text/css">
input {
	color: #fff;
	text-decoration: none;
	padding: 0.5em 1.6em;
	font-size: 0.9em;
	display: inline-block;
	border-radius: 5px;
	-moz-border-radius: 5px;
	-webkit-border-radius: 5px;
	-o-border-radius: 5px;
	margin: 1.5em 16px 0px 0px;
	background: #F07818;
	border: 1px solid #F07818;
	padding-right:40px;
}

</style>
</head>

    


<body>
    <!-- Preloader -->
    <div class="preloader d-flex align-items-center justify-content-center">
        <div class="cssload-container">
            <div class="cssload-loading"><i></i><i></i><i></i><i></i></div>
        </div>
    </div>

    <!-- ##### Header Area Start ##### -->
    <header class="header-area">
        <!-- Navbar Area -->
        <div class="palatin-main-menu">
            <div class="classy-nav-container breakpoint-off">
                <div class="container">
                    <!-- Menu -->
                    <nav class="classy-navbar justify-content-between" id="palatinNav">

                        <!-- Nav brand -->
                        <a href="index.jsp" class="nav-brand"><img src="${pageContext.request.contextPath}/front/img/core-img/logo.png" alt=""></a>

                        <!-- Navbar Toggler -->
                        <div class="classy-navbar-toggler">
                            <span class="navbarToggler"><span></span><span></span><span></span></span>
                        </div>

                        <!-- Menu -->
                        <div class="classy-menu">

                            <!-- close btn -->
                            <div class="classycloseIcon">
                                <div class="cross-wrap"><span class="top"></span><span class="bottom"></span></div>
                            </div>

                            <!-- Nav Start -->
                            <div class="classynav">
                                <ul id="btn">
                                   <!--  <li><a href="login.jsp">登录</a></li>
                                    <li><a href="register.jsp">注册</a></li> -->
                                </ul>

                                <!--  个人中心菜单栏     -->           
	                             <!-- <ul>	                                    
	                                <li><a href="#">个人中心</a>
	                                        <ul class="dropdown">
	                                            <li><a href="#" class="personalData login">个人信息</a></li>
	                                            <li><a href="#" class="orderInfo login">订单详情</a></li>
	                                            <li><a href="#" class="collectionInfo login">个人收藏</a></li>
	                                            <li><a href="#" class="updatePassword login">修改密码</a></li>
	                                            <li><a href="login.jsp" class="outLogin">切换账号</a></li> 
	                                        </ul>
	                                </li>                                   
	                             </ul>   -->
	                                <!--   天气预报 -->
                                <ul>
                                	<!-- <input type="text" name="input"/> -->
                                    <li><a href="#" class="nav-brand" data-toggle="modal" data-target="#myModal0" id="wether">天气预报</a></li>
                                </ul>  
                                <ul>
                                	<li><a href="${pageContext.request.contextPath}/back/login.jsp">进入后台</a></li>
                                </ul>                             
                                </ul>                              
                            </div>
                            <!-- Nav End -->
                        </div>
                    </nav>
                </div>
            </div>
        </div>
    </header>
    <!-- ##### Header Area End ##### -->

    <!-- ##### Breadcumb Area Start ##### -->
    <section class="breadcumb-area bg-img d-flex align-items-center justify-content-center" style="background-image: url(img/bg-img/bg-7.jpg);">
        <div class="bradcumbContent">
           <!--  <h2>News</h2> -->
        </div>
    </section>
    
    <!-- ##### Blog Area Start ##### -->
    <div class="blog-area section-padding-0-100">
        <div class="container">
            <div class="row">
                <div class="col-12">
                    <div class="palatin-blog-posts">

                        <!--//single-page-->
    <form id="submitInfo"  action="${pageContext.request.contextPath}/OrderInfoServlet?roomId=${param.roomId}&roomPrice=${param.roomPrice}&inTime=${param.inTime}&outTime=${param.outTime}" method="post" >	
    <input type="hidden" name="op" value="sendOrderInfo"> 
	<div class="single" >
		<div class="container">
			<div class="single-grids">				
				<div class="col-md-4 single-grid">		
					<div class="flexslider" width="200px" heigth="100px">
						<ul class="slides" id="roompicture">
							<%-- <li data-thumb="${pageContext.request.contextPath}/FileDownloadServlet?fileName=${sessionScope.HomePictureInfo.roomPicture}">
								<div class="thumb-image"> <img src="${pageContext.request.contextPath}/FileDownloadServlet?fileName=${sessionScope.HomePictureInfo.roomPicture}" data-imagezoom="true" class="img-responsive"> </div>
							</li>
							<li data-thumb="${pageContext.request.contextPath}/FileDownloadServlet?fileName=${sessionScope.HomePictureInfo.roomPicture}">
								 <div class="thumb-image"> <img src="${pageContext.request.contextPath}/FileDownloadServlet?fileName=${sessionScope.HomePictureInfo.roomPicture}" data-imagezoom="true" class="img-responsive"> </div>
							</li>
							<li data-thumb="${pageContext.request.contextPath}/FileDownloadServlet?fileName=${sessionScope.HomePictureInfo.roomPicture}">
							   <div class="thumb-image"> <img src="${pageContext.request.contextPath}/FileDownloadServlet?fileName=${sessionScope.HomePictureInfo.roomPicture}" data-imagezoom="true" class="img-responsive"> </div>
							</li>  --%>
						</ul>
					</div>
				</div>
				 
				<div class="col-md-4 single-grid simpleCart_shelfItem" >
					 <ul class="size" id="homeIntroduce">
						<!-- <h3>民宿介绍</h3>
							<p></p>  -->
					</ul>
					<ul class="size" id="homePhone">
						<!-- <h3>联系电话</h3>
							<p></p> -->
					</ul>
				</div> 
				<div class="col-md-4 single-grid1">
					<h2>订单信息</h2>
					<ul>
						<li>住客姓名:<input type="text" class="" name="username" id="username" value="${sessionScope.user.userName}" /></li>
						<li>联系方式:<input type="tel" class="" name="phonenum" id="phonenum" value="${sessionScope.user.userPhone}" /></li>
						<li>退款规则:</li>
						<h4>根据民宿政策，当天预订的民宿，在当天18点之前可以免费取消。如有其它疑问，请咨询本店。</h3>
						<div id="roomPrice">
							<h4 id=>房间价格:${param.roomPrice}</h4>
						<div class="clearfix" id="tip"></div> 
							<input type="submit"  width="500px" name="getvalue" id="subOrder"  value="提交订单" /> 
						</div>
					</ul>
				</div>
				</form>
				<div class="clearfix"></div>
			</div>
		</div> 
	</div>
							<div class="col-12">
								<div class="load-more-btn text-center wow fadeInUp"
									data-wow-delay="700ms">
									<a href="#" class="btn palatin-btn">Load More</a>
								</div>
								<div id="comment">
								</div>
							</div>
						</div>
					</div>
    </div>
    <!-- ##### Blog Area End ##### -->

    <!-- ##### Footer Area Start ##### -->
    <footer class="footer-area">
        <div class="container">
            <div class="row">

                <!-- Footer Widget Area -->
                <div class="col-12 col-lg-5">
                    <div class="footer-widget-area mt-50">
                        <a href="#" class="d-block mb-5"><img src="img/core-img/logo.png" alt=""></a>
                        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec malesuada lorem maximus mauris sceleri sque, at rutrum nulla dictum. Ut ac ligula sapien. Suspendisse cursus faucibus finibus. </p>
                    </div>
                </div>
                <!-- Footer Widget Area -->
                <div class="col-12 col-md-6 col-lg-4">
                    <div class="footer-widget-area mt-50">
                        <h6 class="widget-title mb-5">Find us on the map</h6>
                        <img src="img/bg-img/footer-map.png" alt="">
                    </div>
                </div>
                <!-- Footer Widget Area -->
                <div class="col-12 col-md-6 col-lg-3">
                    <div class="footer-widget-area mt-50">
                        <h6 class="widget-title mb-5">Subscribe to our newsletter</h6>
                        <form action="#" method="post" class="subscribe-form">
                            <input type="email" name="subscribe-email" id="subscribeemail" placeholder="Your E-mail">
                            <button type="submit">Subscribe</button>
                        </form>
                    </div>
                </div>
                <!-- Copywrite Text -->
                <div class="col-12">
                    <div class="copywrite-text mt-30">
                        <p><a href="#"><!-- Link back to Colorlib can't be removed. Template is licensed under CC BY 3.0. -->
Copyright &copy;<script>document.write(new Date().getFullYear());</script> All rights reserved | This template is made with <i class="fa fa-heart-o" aria-hidden="true"></i> by <a href="https://colorlib.com" target="_blank">Colorlib</a>
<!-- Link back to Colorlib can't be removed. Template is licensed under CC BY 3.0. --></p>
                    </div>
                </div>
            </div>
        </div>
    </footer>
	<!-- 查看评论详情以及子评论模态框（Modal） -->
	<div class="modal fade" id="commentChildrenModal" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">&times;</button>
					<h4 class="modal-title" id="myModalLabel">评论详情</h4>
				</div>
				<div class="modal-body" id="commentDetail">在这里添加一些文本</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				</div>
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal -->
	</div>
	<!-- 回复评论模态框（Modal） -->
	<div class="modal fade" id="replyModal" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">&times;</button>
					<h4 class="modal-title" id="myModalLabel">回复详情</h4>
				</div>
				<div class="modal-body" id="replyDetail">
				<input type="hidden" id="parentId" value="">
				<textarea name="message" class="form-control" id="replyMessage" cols="30" rows="10" placeholder="对当前评论进行回复"></textarea>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
					<button type="button" class="btn btn-primary" id="replySubmit">立即回复</button>
				</div>
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal -->
	</div>
    <!-- ##### Footer Area End ##### -->

    <!-- ##### All Javascript Script ##### -->
    <!-- jQuery-2.2.4 js -->
    <script src="../front/js/jquery/jquery-2.2.4.min.js"></script>
    <!-- Popper js -->
    <script src="../front/js/bootstrap/popper.min.js"></script>
    <!-- Bootstrap js -->
<!--     <script src="../front/js/bootstrap/bootstrap.min.js"></script> -->
    <!-- All Plugins js -->
    <script src="../front/js/plugins/plugins.js"></script>
    <!-- Active js -->
    <script src="js/active.js"></script>
    
    <!-- 模态框 -->                            
		<!-- 模态框0：天气预报信息 -->
		<div class="modal fade" id="myModal0">
						<div class="widget-main modal-dialog">
						   <div class="widget-climate-wthree">
								<div class="widget-left">
									<div class="season">
										<div class="degree">
											<h4>城市</h4>
											<h3 id="humidity"></h3>
										</div>
										<div class="date">
											<h6 class="now_time"></h6>
										</div>
									   <div class="clear"> </div>
									</div>
									<div class="season w3">
										<div class="degree">
											<h4>天气</h4>
											<h3 id="info"></h3>
										</div>
										<div class="date">
											<h6 class="now_time"></h6>
										</div>
									   <div class="clear"> </div>
									</div>
									<div class="season agile">
										<div class="degree">
											<h4>风向</h4>
											<h3 id="direct"></h3>
										</div>
										<div class="date">
											<h6 class="now_time"></h6>
										</div>
									   <div class="clear"> </div>
									</div>
									<div class="season">
										<div class="degree">
											<h4>风级</h4>
											<h3 id="power"></h3>
										</div>
										<div class="date">
											<h6 class="now_time"></h6>
										</div>
									   <div class="clear"> </div>
									</div>
									
								</div>		
								<div class="widget-right w3l">
									<p id="week"></p>
									<p id="year_month"></p>
									<h5>Mostly Sunny</h5>
									
									<h2 id="temperature"></h2>
								</div>
							 <div class="clear"> </div>				
						  </div>
						 
					</div>				 
					<!-- 模态框底部 -->
						<!-- <div class="modal-footer">
							<button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
						</div> -->									 
		 </div> 
										 
		<!-- 模态框1：用户个人信息 -->
		<div class="modal fade" id="myModal1">
			<div class="modal-dialog">
				<div class="modal-content" style="width:700px;" align="center">
											 
					<!-- 模态框头部 -->
						<div class="modal-header">
						<h4 class="modal-title">个人中心</h4>
							<button type="button" class="close" data-dismiss="modal">&times;</button>
						</div>
													 
					<!-- 模态框主体 -->
						<div class="modal-body">
							<p>用户头像：</p><div id="picture"></div>
							<p>用户名： <div><input type="text" name="username" disabled="disabled" /></div></p>
							<p>性别：<div><input type="text" name="userSex" disabled="disabled" /></div></p>
							<p>电话：<div><input type="text" name="userPhone" disabled="disabled" /></div></p>
						</div>
													 
					<!-- 模态框底部 -->
						<div class="modal-footer">
							<button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
						</div>											 
			  </div>
			</div>
		</div>
		
		<!-- 模态框2：订单信息 -->
		<div class="modal fade" id="myModal2">
			<div class="modal-dialog">
				<div class="modal-content" style="width:700px;" align="center">
											 
					<!-- 模态框头部 -->
						<div class="modal-header">
						<h4 class="modal-title">订单详情</h4>
							<button type="button" class="close" data-dismiss="modal">&times;</button>
							
						</div>
													 
					<!-- 模态框主体 -->
						<div class="modal-body">
						<div>
							<label>每页
								 <!-- 下拉框 -->
								 <select style="width:50px" id="selectPageSize">
									<option value="1">1</option>
									<option value="2">2</option>
									<option value="3">3</option>
								 </select>
									 条
								</label> 
								民宿名称：<input type="text" id="kw" value=""/>
								<button class="btn btn-success btn-mini" id="searchBtn" >搜索</button>
								<button class="btn btn-info btn-mini" id="clearSearchBtn"   >清除搜索</button>
							</div>
							<table class="table table-bordered data-table" border="1" style="width: 100%;margin: 10px 0;">		
								<thead>
								<tr align="center">
									<!-- 订单编号  订单名称（民宿名+房号） 总价格 支付状态（未支付 去支付） 添加时间(当点击下单之后，获取系统当前时间)   操作（修改、删除） -->
										<td>订单编号</td>
										<td>订单名称</td>
										<td>总价格</td>
										<td>支付状态</td>
										<td>添加时间</td>
										<td>操作</td>
									</tr>
								</thead>
								<tbody id="content_order">
									<!-- <tr align="center" id="content_order">								
										<td>1</td>
										<td>1</td>
										<td>1</td>
										<td>1</td>
										<td>1</td>
										<td>
										    <a href="#" class="delete">删除</a>
										</td>
									</tr> -->
								</tbody>
							</table>
							<!-- 分页 -->
							<div id="DataTables_pageInfo"></div>
						</div>
													 
					<!-- 模态框底部 -->
						<div class="modal-footer">
							<button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
						</div>											 
			  </div>
			</div>
		</div>
		
		<!-- 模态框3：收藏信息 -->
		<div class="modal fade" id="myModal3">
			<div class="modal-dialog">
				<div class="modal-content" style="width:700px;" align="center">
											 
					<!-- 模态框头部 -->
						<div class="modal-header">
						<h4 class="modal-title">个人收藏</h4>
							<button type="button" class="close" data-dismiss="modal">&times;</button>
							
						</div>
													 
					<!-- 模态框主体 -->
						<div class="modal-body">
						<div>
							<label>每页
								 <!-- 下拉框 -->
								 <select style="width:50px" id="selectPageSize1">
									<option value="1">1</option>
									<option value="2">2</option>
									<option value="3">3</option>
								 </select>
									 条
								</label> 
								民宿名称：<input type="text" id="kw1" value=""/>
								<button class="btn btn-success btn-mini" id="searchBtn1" >搜索</button>
								<button class="btn btn-info btn-mini" id="clearSearchBtn1"   >清除搜索</button>
							</div>
							<table class="table table-bordered data-table" border="1" style="width: 100%;margin: 10px 0;">	
								<thead>
									<tr align="center">
									<!-- 收藏信息：（收藏编号(homeid+userid) + 收藏的民宿 + 收藏时间(点点击收藏按钮之后，获取系统当前时间)+ 操作：删除） -->
										<td>收藏编号</td>
										<td>收藏民宿</td>									
										<td>收藏时间</td>
										<td>操作</td>
									</tr>
								</thead>
								<tbody id="content_collection">
									<!-- <tr align="center">								
										<td>1</td>
										<td>1</td>
										<td>1</td>
										<td><a href="#">删除</a></td>
									</tr> -->
								</tbody>
							</table>
							<!-- 分页 -->
							<div id="DataTables_pageInfo1"></div>
						</div>
													 
					<!-- 模态框底部 -->
						<div class="modal-footer">
							<button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
						</div>											 
			  </div>
			</div>
		</div>
		
		<!-- 模态框4：修改密码  -->
		<div class="modal fade" id="myModal4">
			<div class="modal-dialog">
				<div class="modal-content">
											 
					<!-- 模态框头部 -->
						<div class="modal-header">
						<h4 class="modal-title">修改密码</h4>
							<button type="button" class="close" data-dismiss="modal">&times;</button>
						</div>
													 
					<!-- 模态框主体 -->
						<div class="modal-body">
							<div>原 密 码： <input type="password" placeholder="请输入原密码" name="password"/></div>
							<div>新 密 码： <input type="password" placeholder="请输新密码" name="newPwd" id="new1"/></div>
							<div>再次输入：<input type="password" placeholder="请输入新密码" name="newPwd" id="new2"/></div>
						</div>
					<!-- 模态框底部 -->
						<div class="modal-footer sub">
							<button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
							<button type="button" class="btn btn-secondary sub_pwd" data-dismiss="modal">提交</button>
						</div>											 
			  </div>
			</div>
		</div>
    
</body>

 <script type="text/javascript">
 
 $(document).ready(function(){
  
	 var intime="${param.inTime}";
	
	 var outtime="${param.outTime}";
	 if(intime==""&&outtime==""){
		 $("#subOrder").css({'background-color' : 'gray'});
		 $("#subOrder").attr("disabled", true);
		 $("#tip").append("错误提示:");
		 $("#tip").append("请选择入住时间;");
	 }else{
		 $("#subOrder").attr("disabled", false);
		 $("#tip").empty();
	 } 
	 var user = "${sessionScope.user}";
	 console.log("3545674567567"+user);
	 if(user==""){
		alert("请先登录");
		 $("#subOrder").css({'background-color' : 'gray'});
		 $("#subOrder").attr("disabled", true);
		
		 $("#tip").append("请先登录;");
	 }else{
		 $("#subOrder").attr("disabled", false);
		 $("#tip").empty();
	 }

	 
  		
   	$.ajax({
    		async:true,
    		url:"${pageContext.request.contextPath}/OrderInfoServlet",
    		type:"GET",
    		data:{op:"fillRoomMessage",roomId:"${param.roomId}"},
    		dataType:"json",
    		success:function(result,status,xhl){
    			console.log(result);
    			fillMessage(result);
    			
    		},
    		//请求失败时的响应函数
    		error:function(xhr,status,error){
    			console.log("请求失败");
    		}
    	});
   


	$.ajax({
		async:true,
		url:"${pageContext.request.contextPath}/OrderInfoServlet",
		type:"GET",
		data:{op:"fillInfoMessage",roomId:"${param.roomId}"},
		dataType:"json",
		success:function(result,status,xhl){
			console.log(result);
			fillDate(result);
		},
		//请求失败时的响应函数
		error:function(xhr,status,error){
			console.log("请求失败");
		}
	});




function fillMessage(result){
for (var i = 0; i < result.length; i++) {
		$("#roompicture").append(
						"<li data-thumb=\"${pageContext.request.contextPath}/FileDownloadServlet?fileName="
								+ result[i].roomPicture
								+ "\">"
								+ "<div class=\"thumb-image\">"
								+ "<img src=\"${pageContext.request.contextPath}/FileDownloadServlet?fileName="
								+ result[i].roomPicture
								+ "\" data-imagezoom=\"true\" class=\"img-responsive\">"
								+ "</div>" + "</li>"
						);
	}
}
function fillDate(result){
$("#homeIntroduce").append(
	 "<h3>民宿介绍</h3>"
		+"<p>"+result[0].homeIntroduce+"</p>" 
);
$("#homePhone").append(
	 "<h3>联系电话</h3>"
		+"<p>"+result[0].homePhone+"</p>"
);
}
		 //显示所有的评价
         //author:liumeiqi777
    	 $.ajax({
				  async:true,
				  url:"${pageContext.request.contextPath}/CommentServlet",
				  type:"GET",
				  data:{op:"findComment",roomId:"${param.roomId}"},
				  dataType:"json",
				  success:function(result,status,xhl){
					  console.log(result);
					//遍历父评论
					  for(var i = 0;i < result.length ;i++){
							  $("#comment").append("<div id=\"showComment\">"
										+"<div style=\"border:2px solid green\">"
								        +"<span>评价人："+result[i].userName+"</span>&nbsp;<span>评价时间："+result[i].commentTime+"</span>"
								        +"<div>用户评分："+result[i].commentScore+"</div>"
								        +"<div id=\"comment-area\">"
									    +result[i].commentContent
								        +"</div>"
//		 						        <!-- 按钮触发查看评论详情模态框 -->
								        +"<button class=\"btn-primary btn-xs\" data-toggle=\"modal\" data-target=\"#commentChildrenModal\" id=\"findChildren\">查看更多</button>"
								        +"<button class=\"btn-primary btn-xs\" data-toggle=\"modal\" data-target=\"#replyModal\" id=\"reply\">立即回复</button>"
								        +"<input type=\"hidden\" id=\"parentId\" value=\""+result[i].commentId+"\">"
							      +"</div>" );
						  }
					 
					
		 		},
		 		//请求失败时的响应函数
		 		error:function(xhr,status,error){
		 			console.log("请求失败");
		 		}
		  })

   //查看更多评价按钮添加点击事件（查看子评论）
   //author:liumeiqi777
   $(document).on("click","#findChildren",function(){
	      var parentId = $(this).next().next().val();
		  $.ajax({
			  async:true,
			  url:"${pageContext.request.contextPath}/CommentServlet",
			  type:"GET",
			  data:{op:"findChildrenComment",parentId:parentId},
			  dataType:"json",
			  success:function(result,status,xhl){
				  $("#commentDetail").html("");
				  for(var i = 0;i < result.length;i++){
						 $("#commentDetail").append("<div id=\"showComment\">"
									+"<div style=\"border:2px solid burlywood\">"
							        +"<span>评价人："+result[i].userName+"</span>&nbsp;<span>评价时间："+result[i].commentTime+"</span>"
							        +"<div id=\"comment-area\">"
								    +result[i].commentContent
							        +"</div>"
// 							        <!-- 按钮触发查看评论详情模态框 -->
							        +"<button class=\"btn-primary btn-xs\" id=\"findChildrenDetail\">查看详情</button>"
							        +"<button class=\"btn-primary btn-xs\" data-toggle=\"modal\" data-target=\"#replyModal\" id=\"reply\">立即回复</button>"
							        +"<input type=\"hidden\" id=\"parentId\" value=\""+result[i].commentId+"\">"
						      +"</div>" );
				      }
			  },
		 		error:function(xhr,status,error){
		 			console.log("请求失败");
		 	}
		  
         })	
  })
   //弹出评论回复模态框
   //author:liumeiqi777
   $(document).on("click","#reply",function(){
	 
			  var parentId = $(this).next().val();
		      $("#replyDetail #parentId").attr("value",parentId);
		      var commentContent = $("#replyMessage").val("");
  })
  //对某个评论进行评论
  //author:liumeiqi777
  $(document).on("click","#replySubmit",function(){
	  var loginState="<%=session.getAttribute("user")%>";
	  if(loginState == 'null'){
			alert("请登录");
			$('#replyModal').modal('hide');
			$(".modal-backdrop.fade").hide();
	  }else{
	  var parentId = $("#replyDetail #parentId").attr("value");//获取当前父评论的id
	  var commentContent = $("#replyMessage").val();//获取要回复的文本内容
	  $.ajax({
		  async:true,
		  url:"${pageContext.request.contextPath}/CommentServlet",
		  type:"GET",
		  data:{op:"replyComment",parentId:parentId,commentContent:commentContent},
		  success:function(result,status,xhl){
			 alert(result);
			 $('#replyModal').modal('hide');
			 $(".modal-backdrop.fade").hide();
		  },
	 	  error:function(xhr,status,error){
	 			console.log("请求失败");
	 			$('#replyModal').modal('hide');
				$(".modal-backdrop.fade").hide();
	 	}

	  })
   }
  });
  //对子评论的评论进行显示
 $(document).on("click","#findChildrenDetail",function(){
	 var parentId = $(this).next().next().val();
	  $.ajax({
		  async:true,
		  url:"${pageContext.request.contextPath}/CommentServlet",
		  type:"GET",
		  data:{op:"findChildrenComment",parentId:parentId},
		  dataType:"json",
		  success:function(result,status,xhl){
			  $("#commentDetail").html("");
			  for(var i = 0;i < result.length;i++){
					 $("#commentDetail").append("<div id=\"showComment\">"
								+"<div style=\"border:2px solid burlywood\">"
						        +"<span>评价人："+result[i].userName+"</span>&nbsp;<span>评价时间："+result[i].commentTime+"</span>"
						        +"<div id=\"comment-area\">"
							    +result[i].commentContent
						        +"</div>"
//						        <!-- 按钮触发查看评论详情模态框 -->
						        +"<button class=\"btn-primary btn-xs\" id=\"findChildrenDetail\">查看详情</button>"
						        +"<button class=\"btn-primary btn-xs\" data-toggle=\"modal\" data-target=\"#replyModal\" id=\"reply\">立即回复</button>"
						        +"<input type=\"hidden\" id=\"parentId\" value=\""+result[i].commentId+"\">"
					      +"</div>" );
			      }
		  },
	 		error:function(xhr,status,error){
	 			console.log("请求失败");
	 	}
	  
    })	
 })

 });

	</script>
	
	 <script>
		$(document).ready(function(){
			// 获取session中的用户信息
			$("input[name = username]").val("${sessionScope.user.userName}");
			$("input[name = userSex]").val("${sessionScope.user.userSex}");
			$("input[name = userPhone]").val("${sessionScope.user.userPhone}");
		
			var userName = $("input[name = username]").val();
			console.log("zzzzz "+userName);
			var fileName = "${sessionScope.user.userPicture}";
			
			if(userName == ""){
				$(document).on("click",".login",function(){
					alert("请先登录");	
				});
				$(".classynav #btn").append("<li><a href=\"login.jsp\" id=\"doLogin\">登录</a></li>"+
                    "<li><a href=\"register.jsp\" id=\"doRegister\">注册</a></li>");
			}else{
				$(".classynav #btn").append("<li><a href=\"#\" id=\"doLogin\">登录</a></li>"+
                "<li><a href=\"register.jsp\" id=\"doRegister\">注册</a></li>");
                $(document).on("click","#doLogin",function(){
                	alert("不能重复登录！")
                });
				
				// --------个人中心的点击，显示个人信息模态框-------
				$(document).on("click",".personalData",function(){
					$('#myModal1').modal('show');	
					$("#picture").empty();
					// 判断是否有头像，有就下载，没有就使用默认的 images/2.jpg
						if(fileName != ""){
							$("#picture").append("<img src=\"${pageContext.request.contextPath}/FileDownloadServlet?fileName="+fileName+"\" width=\"50\" height=\"50\" />")
						}else if(fileName == ""){
							$("#picture").append("<img src=\"${pageContext.request.contextPath}/front/images/2.jpg\" width=\"50\" height=\"50\" />")
						}
				});
				// 个人中心的点击，显示订单信息模态框
				$(document).on("click",".orderInfo",function(){
					$('#myModal2').modal('show');
				});
				// 个人中心的点击，显示收藏信息模态框
				$(document).on("click",".collectionInfo",function(){
					$('#myModal3').modal('show');
				});
				// 个人中心的点击，显示修改密码信息模态框
				$(document).on("click",".updatePassword",function(){
					$('#myModal4').modal('show');
				});
				
				// --------修改密码模块--------		
				// 1.判断用户输入的原密码是否正确
				
				 $("input[name = password]").change( function() { 
					 var password = $("input[name = password]").val();
					 $.ajax({
							async:true,
							url:"${pageContext.request.contextPath}/RegisterAndLoginServlet",
							type:"GET",
							data:{op:"isLogin",password:password,userName:userName},
							dataType:"json",
							success:function(result,status,xhr){
								if(result != null){
									alert("原密码输入正确");	
								}else{
									alert("密码错误，请重新输入！");
									// 密码输入有误，清空密码框，重新输入
									$("input[name = password]").val("");
								}							
							},
							error:function(xhr,status,error){
								alert("异步请求失败!");
							}
					});
				});
				
				// 2.点击提交按钮，判断用户的两次新密码是否一致
				$(document).on("click",".sub .sub_pwd",function(){
					var userNo = "${sessionScope.user.userId}";
					
					var password = $("input[name = password]").val();
					var newPwd1 = $("#new1").val();
					var newPwd2 = $("#new2").val();
					if(newPwd1.trim() == "" && newPwd2.trim() == "" || newPwd1 != newPwd2 || password == ""){
						
						alert("两次密码输入不一致，请重新输入！");
						// 密码输入有误，清空密码框，重新输入
						$("#new1").val("");
						$("#new2").val("");
					}else if(newPwd1.trim().length < 6 || newPwd1.trim().length > 30 || newPwd2.trim().length < 6 || newPwd2.trim().length > 30){
						alert("请密码长度在6~30之间！");
						// 密码输入有误，清空密码框，重新输入
						$("#new1").val("");
						$("#new2").val("");
					}else if(newPwd1 == newPwd2){
						// 当两次密码一致时，发送ajax请求，修改密码，并加密
						$.ajax({
							async:true,
							url:"${pageContext.request.contextPath}/UserUpdateServlet",
							type:"Get",
							data:{op:"updatePassword",newPwd1:newPwd1,userNo:userNo},
							success:function(result,status,xhr){
								console.log("密码修改的json："+result);
								if(result == true){
									alert("密码修改成功！请重新登录！");
									// 修改成功，跳转登录页面重新登录！
									window.location.href = "../front/login.jsp";
								}else if(result == false){
									alert("密码修改失败！");
								}
								
							},
							error:function(xhr,status,error){
								alert("异步请求失败！");
							}
						});
					}
				});		
				
				// --------切换账号模块--------
				// 点击切换账号，返回login.jsp页面，并将账号信息注销
				$(document).on("click",".outLogin",function(){
					$.ajax({
						async:true,
						url:"${pageContext.request.contextPath}/UserUpdateServlet",
						type:"GET",
						data:{op:"outLogin"},
						success:function(result,status,xhr){
							alert("注销账号成功！");
						},
						error:function(xhr,status,error){
							alert("异步请求失败！");
						}
					});
				});
		}
			
			// --------天气预报模块--------
			$(document).on("click","#wether",function(){
				/* 获取输入的城市 */
				var input = "${sessionScope.city}";
				console.log(input);
				
				$.ajax({
					async:true,
					url:"${pageContext.request.contextPath}/APIServlet",
					type:"GET",
					data:{op:"getCityWethor",input:input},
					dataType:"json",
					success:function(result,status,xhr){
						console.log(result);
						alert("成功");
						$("#humidity").text(result.result.data.realtime.city_name);
						$("#info").text(result.result.data.realtime.weather.info);
						$("#direct").text(result.result.data.realtime.wind.direct);
						$("#power").text(result.result.data.realtime.wind.power);
						 var myDate = new Date();
						 var month = myDate.getMonth()+1;
						 console.log(result);
						 $("#year_month").text(month + "月  " + myDate.getFullYear() + "年");
						 $("#week").text("星期" + myDate.getDay());
						 $("#temperature").text(result.result.data.realtime.weather.temperature + "℃")
					},
					error:function(xhr,status,error){
						alert("异步请求失败!");
					}
				});
			});
	});
</script>

  <!-- --------订单信息列表-------- -->
<script type="text/javascript">
		$(document).ready(function(){
			$(document).on("click",".orderInfo",function(){
				sendAjax1(1);
			});
			
			// 1.首页
			$(document).on("click","#first1",function(){
				// 调用发送异步请求的方法,参数是页码
				sendAjax1(1);
			});
			
			// 2.尾页
			$(document).on("click","#last1",function(){
				// 获取总页数
				var lastPageNum1 = $("#pageInfo1").data("pagepages1");
				var pageNum1 = lastPageNum1;
				// 调用发送异步请求的方法,参数是页码
				sendAjax1(pageNum1);
			});
			
			// 3.上一页
			$(document).on("click","#previous1",function(){
				// 获取当前页
				var currentPageNum1 = $("#pageInfo1").data("pagenum1");
				if(currentPageNum1==1){
					alert("已经是第一页,没有上一页!")
				}else{
					var pageNum1 = parseInt(currentPageNum1)-1;
					// 调用发送异步请求的方法,参数是页码
					sendAjax1(pageNum1);
				}
			});
			
			// 4.下一页
			$(document).on("click","#next1",function(){
				// 获取当前页
				var currentPageNum1 = $("#pageInfo1").data("pagenum1");
				// 获取总页数
				var lastPageNum1 = $("#pageInfo1").data("pagepages1");
				if(currentPageNum1==lastPageNum1){
					alert("已经是最后一页,没有下一页!")
				}else{
					var pageNum1 = parseInt(currentPageNum1)+1;
					// 调用发送异步请求的方法,参数是页码
					sendAjax1(pageNum1);
				}
			});
			
			// 5.页码点击事件
			$(document).on("click",".current1",function(){
				 var pageNum1 = $(this).text();
				// 调用发送异步请求的方法,参数是页码
				 sendAjax1(pageNum1);
			});
			
			// 6.选择显示记录数的下拉框事件
			$(document).on("change","#selectPageSize",function(){
				// 调用发送异步请求的方法,参数是页码
				sendAjax1(1);
			});
			
			// 7.搜索事件
			$(document).on("click","#searchBtn",function(){
				// 调用发送异步请求的方法,参数是页码
				sendAjax1(1);
			});
			
			// 8.清除搜索事件
			$(document).on("click","#clearSearchBtn",function(){
				$("#kw").val("");
				// 调用发送异步请求的方法,参数是页码
				sendAjax1(1);
			});
			
			//9.删除事件
			$(document).on("click",".delete_order",function(){
				 if(window.confirm("是否确定删除")){
					  var orderNo = $("#orderId").text();
					  console.log("自定义："+orderNo);
					  var num = "1";
					  $.ajax({
							async:true,
							url:"${pageContext.request.contextPath}/UserUpdateServlet",
							type:"GET",
							data:{op:"deleteByOrderNo",
								  orderNo:orderNo,
								  homeNameKey:$("#kw").val(),
								  roomNoKey:"2001",
								  num:num,
								  pageNum: $("#pageInfo1").data("pagenum1"),
								  pageSize:$("#selectPageSize").val()
							},
							dataType:"json",
							success:function(result,status,xhr){
								// 调用数据渲染的方法
								showData1(result);
							},
							error:function(xhr,status,error){
								alert("异步请求失败!");
							}
					  });
				  }
			});
			//10.评论事件
			$(document).on("click",".orderState",function(){
				
			})
			
		})
		/*发送ajax异步请求
		  参数：pageNum 页码
		*/
		function sendAjax1(pageNum1){
			var userNo = "${sessionScope.user.userId}";
			 var num = "1";
			$.ajax({
				async:true,
				url:"${pageContext.request.contextPath}/UserUpdateServlet",
				type:"GET",
				data:{op:"getOrderListByPage",
					  homeNameKey:$("#kw").val(),
					  userNo:userNo,
					  num:num,
					  pageNum:pageNum1,
					  pageSize:$("#selectPageSize").val()
					  },
				dataType:"json",
				success:function(result,status,xhr){
					console.log("页面结果："+result);
					// 调用数据渲染的方法
					showData1(result);
				},
				error:function(xhr,status,error){
					alert("异步请求失败!");
				}
			});
		}
		/*渲染数据
		*/
		function showData1(result){
			// 0.清空表格原始数据
			$("#content_order").empty();
			// 0.清空分页信息原始数据
			$("#DataTables_pageInfo").empty();
			// 1.填充表格数据
			$.each(result.data,function(index,orderInfo){
				var time = "${sessionScope.formatDate}";
				console.log("zzzzzzzz  "+time);
				if(orderInfo.orderState == 0){
					$("#content_order").append("<tr align=\"center\">"+
							"<td class=\"  sorting_1\" id=\"orderId\">"+orderInfo.orderId+"</td>"+
							"<td>"+orderInfo.roomInfo.homeInfo.homeName+orderInfo.roomInfo.roomId+"</td>"+
							"<td>"+orderInfo.roomInfo.roomPrice+"</td>"+
							"<td><a href=\"payindex.jsp\">去支付</a></td>"+
							"<td>"+time+"</td>"+
							"<td>"+
							  "<a href=\"javascript:void(0)\" class=\"delete_order\" data-orderNo=\"'"+orderInfo.orderId+"'\"><i class=\"icon-remove\"></i>删除</a>"+
							  "</td>"+
							"</tr>");
				}else if(orderInfo.orderState == 1){
					$("#content_order").append("<tr align=\"center\">"+
							"<td class=\"  sorting_1\" id=\"orderId\">"+orderInfo.orderId+"</td>"+
							"<td>"+orderInfo.roomInfo.homeInfo.homeName+orderInfo.roomInfo.roomId+"</td>"+
							"<td>"+orderInfo.roomInfo.roomPrice+"</td>"+
							"<td>"+"已支付"+"</td>"+
							"<td>"+time+"</td>"+
							"<td>"+
							  "<a href=\"javascript:void(0)\" class=\"delete_order\" data-orderNo=\"'"+orderInfo.orderId+"'\"><i class=\"icon-remove\"></i>删除</a>"+
							  "<a href=\"${pageContext.request.contextPath}/front/comment.jsp?orderId="+orderInfo.orderId+"\"><i class=\"icon-remove\"></i>去评论</a>"+
							  "</td>"+
							"</tr>");
				}
			});
			
			// 2.填充分页信息
			// 2.1 分页信息
			$("#DataTables_pageInfo").append("<span id=\"pageInfo1\" data-pagenum1=\""+
					result.pageNum+"\"  data-pagesize1=\""+
					result.pageSize+"\"  data-pagetotal1=\""+
					result.total+"\"  data-pagepages1=\""+
					result.pages+"\" style=\"margin: 1px 3px;border: 0.1px solid gray;\">每页"+result.pageSize+"条 共"+result.total+"条 第"+result.pageNum+"/"+result.pages+"页</span>");
			
			// 2.2 首页 上一页
			$("#DataTables_pageInfo").append("<a tabindex=\"0\"class=\"first ui-corner-tl ui-corner-bl fg-button ui-button ui-state-default\" id=\"first1\" style=\"margin: 1px 3px;border: 0.1px solid gray;\">首页</a>"+
					"<a tabindex=\"0\" class=\"previous fg-button ui-button ui-state-default\" id=\"previous1\" style=\"margin: 1px 3px;border: 0.1px solid gray;\">上一页</a>");
			
			// 2.3页码显示
			for(var i=1; i<= result.pages; i++){
				// 判断i==当前页,添加样式ui-state-disabled不可以用,激活状态
				if(i == result.pageNum){
					$("#DataTables_pageInfo").append(
							"<a tabindex=\"0\" class=\"fg-button ui-button ui-state-default ui-state-disabled\" style=\"background:deepskyblue;padding:0px 3px;border: 0.1px solid gray;\">"+i+"</a>");
				}else{
					$("#DataTables_pageInfo").append(
							"<a tabindex=\"0\" class=\"fg-button ui-button ui-state-default current1\">"+i+"</a>");
				}
				
			}
				
			// 2.4下一页 尾页
			$("#DataTables_pageInfo").append("<a tabindex=\"0\"class=\"first ui-corner-tl ui-corner-bl fg-button ui-button ui-state-default\" id=\"next1\" style=\"margin: 1px 3px;border: 0.1px solid gray;\">下一页</a>"+
			"<a tabindex=\"0\" class=\"previous fg-button ui-button ui-state-default\" id=\"last1\" style=\"margin: 1px 3px;border: 0.1px solid gray;\">尾页</a>");
		}
		
	</script>
	
<!-- --------收藏信息列表-------- -->
<script type="text/javascript">
		$(document).ready(function(){
			$(document).on("click",".collectionInfo",function(){
				sendAjax(1);
			});
			
			// 1.首页
			$(document).on("click","#first",function(){
				// 调用发送异步请求的方法,参数是页码
				sendAjax(1);
			});
			
			// 2.尾页
			$(document).on("click","#last",function(){
				// 获取总页数
				var lastPageNum = $("#pageInfo").data("pagepages");
				var pageNum = lastPageNum;
				// 调用发送异步请求的方法,参数是页码
				sendAjax(pageNum);
			});
			
			// 3.上一页
			$(document).on("click","#previous",function(){
				// 获取当前页
				var currentPageNum = $("#pageInfo").data("pagenum");
				if(currentPageNum==1){
					alert("已经是第一页,没有上一页!")
				}else{
					var pageNum = parseInt(currentPageNum)-1;
					// 调用发送异步请求的方法,参数是页码
					sendAjax(pageNum);
				}
			});
			
			// 4.下一页
			$(document).on("click","#next",function(){
				// 获取当前页
				var currentPageNum = $("#pageInfo").data("pagenum");
				// 获取总页数
				var lastPageNum = $("#pageInfo").data("pagepages");
				if(currentPageNum==lastPageNum){
					alert("已经是最后一页,没有下一页!")
				}else{
					var pageNum = parseInt(currentPageNum)+1;
					// 调用发送异步请求的方法,参数是页码
					sendAjax(pageNum);
				}
			});
			
			// 5.页码点击事件
			$(document).on("click",".current",function(){
				 var pageNum = $(this).text();
				// 调用发送异步请求的方法,参数是页码
				 sendAjax(pageNum);
			});
			
			// 6.选择显示记录数的下拉框事件
			$(document).on("change","#selectPageSize1",function(){
				// 调用发送异步请求的方法,参数是页码
				sendAjax(1);
			});
			
			// 7.搜索事件
			$(document).on("click","#searchBtn1",function(){
				// 调用发送异步请求的方法,参数是页码
				sendAjax(1);
			});
			
			// 8.清除搜索事件
			$(document).on("click","#clearSearchBtn1",function(){
				$("#kw1").val("");
			});
			
			//9.删除事件
			$(document).on("click",".delete_collectionInfo",function(){
				 if(window.confirm("是否确定删除")){
					 var collectionNo = $(this).attr("data-collectionNo");
					 console.log(collectionNo);
					  $.ajax({
							async:true,
							url:"${pageContext.request.contextPath}/UserUpdateServlet",
							type:"GET",
							data:{op:"deleteByCollectionNo",
								  collectionNo:collectionNo,
								  homeNameKey:$("#kw").val(),
								  pageNum: $("#pageInfo").data("pagenum"),
								  pageSize:$("#selectPageSize").val()
							},
							dataType:"json",
							success:function(result,status,xhr){
								// 调用数据渲染的方法
								showData(result);
							},
							error:function(xhr,status,error){
								alert("异步请求失败!");
							}
					  });
				  }
			});
			
		})
		/*发送ajax异步请求
		  参数：pageNum 页码
		*/
		function sendAjax(pageNum){
			$.ajax({
				async:true,
				url:"${pageContext.request.contextPath}/UserUpdateServlet",
				type:"GET",
				data:{op:"getCollectionListByPage",
					  homeNameKey:$("#kw1").val(),
					  pageNum:pageNum,
					  pageSize:$("#selectPageSize1").val()
					  },
				dataType:"json",
				success:function(result,status,xhr){
					// 调用数据渲染的方法
					showData(result);
				},
				error:function(xhr,status,error){
					alert("异步请求失败!");
				}
			});
		}
		/*渲染数据
		*/
		function showData(result){
			// 0.清空表格原始数据
			$("#content_collection").empty();
			// 0.清空分页信息原始数据
			$("#DataTables_pageInfo1").empty();
			// 1.填充表格数据
			$.each(result.data,function(index,collectionInfo){
				$("#content_collection").append("<tr align=\"center\">"+
						"<td class=\"  sorting_1\">"+collectionInfo.homeInfo.homeId+collectionInfo.userInfo.userId+"</td>"+
						"<td>"+collectionInfo.homeInfo.homeName+"</td>"+
						"<td>"+"123"+"</td>"+
						"<td>"+
						  "<a href=\"javascript:void(0)\" class=\"delete_collectionInfo\" data-collectionNo=\""+collectionInfo.collectionId+"\"><i class=\"icon-remove\"></i>删除</a>"+
						 "</td>"+
						"</tr>");
			});
			
			// 2.填充分页信息
			// 2.1 分页信息
			$("#DataTables_pageInfo1").append("<span id=\"pageInfo\" data-pagenum=\""+
					result.pageNum+"\"  data-pagesize=\""+
					result.pageSize+"\"  data-pagetotal=\""+
					result.total+"\"  data-pagepages=\""+
					result.pages+"\" style=\"margin: 1px 3px;border: 0.1px solid gray;\">每页"+result.pageSize+"条 共"+result.total+"条 第"+result.pageNum+"/"+result.pages+"页</span>");
			
			// 2.2 首页 上一页
			$("#DataTables_pageInfo1").append("<a tabindex=\"0\"class=\"first ui-corner-tl ui-corner-bl fg-button ui-button ui-state-default\" id=\"first\" style=\"margin: 1px 3px;border: 0.1px solid gray;\">首页</a>"+
					"<a tabindex=\"0\" class=\"previous fg-button ui-button ui-state-default\" id=\"previous\" style=\"margin: 1px 3px;border: 0.1px solid gray;\">上一页</a>");
			
			// 2.3页码显示
			for(var i=1; i<= result.pages; i++){
				// 判断i==当前页,添加样式ui-state-disabled不可以用,激活状态
				if(i == result.pageNum){
					$("#DataTables_pageInfo1").append(
							"<a tabindex=\"0\" class=\"fg-button ui-button ui-state-default ui-state-disabled\" style=\"background:deepskyblue;padding:0px 3px;border: 0.1px solid gray;\">"+i+"</a>");
				}else{
					$("#DataTables_pageInfo1").append(
							"<a tabindex=\"0\" class=\"fg-button ui-button ui-state-default current\">"+i+"</a>");
				}
				
			}
				
			// 2.4下一页 尾页
			$("#DataTables_pageInfo1").append("<a tabindex=\"0\"class=\"first ui-corner-tl ui-corner-bl fg-button ui-button ui-state-default\" id=\"next\" style=\"margin: 1px 3px;border: 0.1px solid gray;\">下一页</a>"+
			"<a tabindex=\"0\" class=\"previous fg-button ui-button ui-state-default\" id=\"last\" style=\"margin: 1px 3px;border: 0.1px solid gray;\">尾页</a>");
		}
		
	</script>
	
</html>